package com.serviceprovider.business.module.check.controller;

//~--- non-JDK imports --------------------------------------------------------

import com.serviceprovider.business.utility.RequestConstants;
import com.serviceprovider.business.utility.SecurityContextUser;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class BlankCheckController {
    protected final Log logger = LogFactory.getLog(getClass());

    @InitBinder
    public void initBinder(WebDataBinder binder) {
        logger.debug("initBinder finished");
    }

    @ModelAttribute("isAdmin")
    public Boolean isAdmin() {
        return SecurityContextUser.isAdmin();
    }

    @RequestMapping(
        value  = RequestConstants.CheckRequests.BLANK_CHECKS,
        method = { RequestMethod.GET, RequestMethod.POST }
    )
    public ModelAndView requestChecks() {
        return requestBlankChecks();
    }

    @RequestMapping(
        value  = RequestConstants.CheckRequests.REQUEST_CHECKS,
        method = { RequestMethod.GET, RequestMethod.POST }
    )
    public ModelAndView requestBlankChecks() {
        ModelAndView result = new ModelAndView(RequestConstants.CheckRequests.VIEW_REQUEST_CHECKS);

        return result;
    }

    @RequestMapping(
        value  = RequestConstants.CheckRequests.PAST_REQUESTS,
        method = { RequestMethod.GET, RequestMethod.POST }
    )
    public ModelAndView pastRequests() {
        ModelAndView result = new ModelAndView(RequestConstants.CheckRequests.VIEW_PAST_REQUESTS);

        return result;
    }

    @RequestMapping(
        value  = RequestConstants.CheckRequests.TRACK_USAGE,
        method = { RequestMethod.GET, RequestMethod.POST }
    )
    public ModelAndView trackUsage() {
        ModelAndView result = new ModelAndView(RequestConstants.CheckRequests.VIEW_TRACK_USAGE);

        return result;
    }

    @RequestMapping(
        value  = RequestConstants.CheckRequests.REPORT_PROBLEMS,
        method = { RequestMethod.GET, RequestMethod.POST }
    )
    public ModelAndView reportProblems() {
        ModelAndView result = new ModelAndView(RequestConstants.CheckRequests.VIEW_REPORT_PROBLEMS);

        return result;
    }
}



